package cn.tedu.csmall.product.schedule;

import cn.tedu.csmall.product.service.IBrandService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class CaSchedule {
    @Autowired
    IBrandService brandService;
    public CaSchedule() {
        log.debug("创建计划任务对象：CacheSchedule");
    }

    /**
     *
     */
    @Scheduled(fixedDelay = 3*60*1000)
    public void xx(){
        log.debug("执行了CacheSchedule的计划任务……");
        log.debug("加载品牌数据到缓存……");
        brandService.lodBrandToCache();
    }
}
